package org.nf.web.param;

import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.nf.web.servlet.MethodArgumentsResovler;
import org.nf.web.servlet.ServletApi;

import java.lang.reflect.Parameter;

/**
 * @Author lzp
 * @Date 2024-05-17
 * 响应对象参数解析器
 */
public class ServletResponseMethodArgumentResolver implements MethodArgumentsResovler {

    @Override
    public boolean suppots(Parameter parameter) {
        return ServletResponse.class.isAssignableFrom(parameter.getType());
    }

    @Override
    public Object resolve(Parameter parameter,ServletApi servletApi) {
        return servletApi.response();
    }
}
